/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.openbrew.openbrewrf;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author chapmand
 */
@Entity
@Table(name = "BarrelAging")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "BarrelAging.findAll", query = "SELECT b FROM BarrelAging b"),
    @NamedQuery(name = "BarrelAging.findByBaid", query = "SELECT b FROM BarrelAging b WHERE b.baid = :baid"),
    @NamedQuery(name = "BarrelAging.findByBADate", query = "SELECT b FROM BarrelAging b WHERE b.bADate = :bADate"),
    @NamedQuery(name = "BarrelAging.findByBABrew", query = "SELECT b FROM BarrelAging b WHERE b.bABrew = :bABrew"),
    @NamedQuery(name = "BarrelAging.findByBAVol", query = "SELECT b FROM BarrelAging b WHERE b.bAVol = :bAVol"),
    @NamedQuery(name = "BarrelAging.findByBANotes", query = "SELECT b FROM BarrelAging b WHERE b.bANotes = :bANotes")})
public class BarrelAging implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "BAID")
    private Integer baid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "BADate")
    @Temporal(TemporalType.DATE)
    private Date bADate;
    @Basic(optional = false)
    @NotNull
    @Column(name = "BABrew")
    private int bABrew;
    @Basic(optional = false)
    @NotNull
    @Column(name = "BAVol")
    private float bAVol;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 250)
    @Column(name = "BANotes")
    private String bANotes;

    public BarrelAging() {
    }

    public BarrelAging(Integer baid) {
        this.baid = baid;
    }

    public BarrelAging(Integer baid, Date bADate, int bABrew, float bAVol, String bANotes) {
        this.baid = baid;
        this.bADate = bADate;
        this.bABrew = bABrew;
        this.bAVol = bAVol;
        this.bANotes = bANotes;
    }

    public Integer getBaid() {
        return baid;
    }

    public void setBaid(Integer baid) {
        this.baid = baid;
    }

    public Date getBADate() {
        return bADate;
    }

    public void setBADate(Date bADate) {
        this.bADate = bADate;
    }

    public int getBABrew() {
        return bABrew;
    }

    public void setBABrew(int bABrew) {
        this.bABrew = bABrew;
    }

    public float getBAVol() {
        return bAVol;
    }

    public void setBAVol(float bAVol) {
        this.bAVol = bAVol;
    }

    public String getBANotes() {
        return bANotes;
    }

    public void setBANotes(String bANotes) {
        this.bANotes = bANotes;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (baid != null ? baid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BarrelAging)) {
            return false;
        }
        BarrelAging other = (BarrelAging) object;
        if ((this.baid == null && other.baid != null) || (this.baid != null && !this.baid.equals(other.baid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.BarrelAging[ baid=" + baid + " ]";
    }
    
}
